Extension point command
Documentation
Extension point to contribute new commands.
Available options are: - name: string attribute used as the command identifier.
- enabled: boolean attribute, command is unavailable if false.
- commandLine: the command to execute.
- parameterString: the parameters to pass to the command. Parameters like #{parameter} represents a file. So you can use either a path to a file or a blob. Parameters like %parameters are literals.
- winParameterString: Same as above but used in windows environments. For instance you have to use double quotes in windows instead of simple quote.
- winCommand: command to execute specifically for windows. Use commandLine is WinCommand is null;
- tester: name of the CommandTester. The CommandTester defined in commandTester extension point. Default is SystemPathExistTester, which look if the command is available in system Path.
- readOutput: Boolean, default is true. If false, command output is never read.
- installationDirective: a String that is returned instead of the usual output when the command isn't available.
CommandLine contribution example:
<command enabled="true" name="myCommand">
<commandLine>commandName</commandLine>
<parameterString> -any -parameters '%specific' %parameters #{blobOrPath}</parameterString>
<winParameterString> -any -parameters "%specific" %parameters " #{blobOrPath}</winParameterString>
<installationDirective>You need to install commandName.</installationDirective>
</command>
Contribution Descriptors
- Class: org.nuxeo.ecm.platform.commandline.executor.service.CommandLineDescriptor
Existing Contributions
Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="identify"> <commandLine>identify</commandLine> <parameterString>-quiet -ping -format '%m %w %h %z %[colorspace]' #{inputFilePath}[0]</parameterString> <winParameterString>-quiet -ping -format "%m %w %h %z %[colorspace]" #{inputFilePath}[0]</winParameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="crop"> <commandLine>stream</commandLine> <parameterString>-quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</parameterString> <winParameterString>-quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="resizer"> <commandLine>convert</commandLine> <parameterString>-quiet -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString> <winParameterString>-quiet -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="gifResizer"> <commandLine>convert</commandLine> <parameterString>-quiet -depth #{targetDept h} #{inputFilePath}[0] -coalesce -resize #{targetWidth}x#{targetHeight} -deconstruct #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="rotate"> <commandLine>convert</commandLine> <parameterString>-quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</parameterString> <winParameterString>-quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="cropAndResize"> <commandLine>stream</commandLine> <parameterString>-quiet -map #{mapComponents} -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} -resize #{targetWidth}x#{targetHeight}! #{mapComponents}:- #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="converter"> <commandLine>convert</commandLine> <parameterString>-quiet #{inputFilePath}[0] #{outputFilePath}</parameterString> <winParameterString>-quiet #{inputFilePath}[0] #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> <command enabled="true" name="multiTiler"> <commandLine>convert</commandLine> <parameterString>-quiet #{inputFilePath}[0] -crop #{tileWidth}x#{tileHeight} +repage #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagic.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="wpd2text"> <commandLine>wpd2text</commandLine> <parameterString> #{inFilePath}</parameterString> <installationDirective>You need to install wpd2text (deb: libwpd-tools) http://libwpd.sourceforge.net/download.html</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="ffmpeg-info"> <commandLine>ffprobe</commandLine> <parameterString> #{inFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-screenshot"> <commandLine>ffmpeg</commandLine> <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file --> <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-screenshot-resize"> <commandLine>ffmpeg</commandLine> <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file. The -vframes 1 option tell to take only one screenshot. This is necessary as apparent the use of the "-s" option forces ffmpeg to switch in "many output files" mode. --> <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 -s #{width}x#{height} #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-towebm"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-tomp4"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libfaac -vcodec libx264 -v 0 #{outFilePath}</parameterString> <winParameterString> -i #{inFilePath} -s #{width}x#{height} -vcodec libx264 -v 0 #{outFilePath}</winParameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-toogg"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="toThumbnail"> <commandLine>convert</commandLine> <parameterString>-quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</parameterString> <winParameterString>-quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="pdftohtml"> <commandLine>pdftohtml</commandLine> <parameterString> -c -enc UTF-8 -noframes #{inFilePath} #{outDirPath}/index.html</parameterString> <winParameterString> -c -enc UTF-8 -noframes #{inFilePath} #{outDirPath}\index.html</winParameterString> <installationDirective>You need to install pdftohtml</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="pdftoimage"> <commandLine>convert</commandLine> <parameterString>-quiet #{sourceFilePath} #{targetFilePath}</parameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>